import { MiddlewareConsumer, Module, NestModule } from "@nestjs/common";
// import { ReqMiddleware } from "src/middlewares/req.middleware";
import { RateLimitMiddleware } from "src/middlewares/rate-limit.middleware";
import { SysModule } from "../../modules/sys-module/sys.module";
// import Modules from "src/modules";

@Module({
  imports:[
    SysModule.setConfig({
      apiPath:"api/",
      adminPath:"admin/"
    })
  ],
  // controllers:[...Modules.ApiControllers],
  // providers:[...Modules.ApiServices]
})
export class ApiModule implements NestModule {
  configure(consumer: MiddlewareConsumer): any {
    // // 处理所有的接口入参
    // consumer.apply(ReqMiddleware).forRoutes("*");
    // // 限制所有接口的请求频率
    // consumer.apply(RateLimitMiddleware).forRoutes("*");
  }
}
